package com.collectionAndMap.map;

import java.util.Objects;

/***
 * @ClassName: Girl
 * @Description:
 * @Auther: 送一一块二向箔
 * @Date: 11:12 2022/2/18
 * @version : V1.0
 */
public class Girl {
    public String name;
    public int id;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Girl girl = (Girl) o;
        return id == girl.id && Objects.equals(name, girl.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, id);
    }

    @Override
    public String toString() {
        return "Girl{" +
                "name='" + name + '\'' +
                ", id=" + id +
                '}';
    }

    public Girl(String name, int id) {
        this.name = name;
        this.id = id;
    }

    public Girl() {
    }

    public String getName() {
        return name;
    }

    public Girl setName(String name) {
        this.name = name;
        return this;
    }

    public int getId() {
        return id;
    }

    public Girl setId(int id) {
        this.id = id;
        return this;
    }
}
